#include <bits/stdc++.h>
using namespace std;

using poly = vector<int>;
using ppp = pair<poly, poly>;
const int N = 10;

ppp dp[N];

poly pmul(const poly &a, const poly &b) {
    poly c(a.size() + b.size() - 1);
    for(int i = 0; i < a.size(); i ++)
        for(int j = 0; j < b.size(); j ++)
            c[i + j] += a[i] * b[j];
    return c;
}

poly pplus(const poly &a, const poly &b) {
    poly c(max(a.size(), b.size()));
    for(int i = 0; i < c.size(); i ++) {
        if(i < a.size()) c[i] += a[i];
        if(i < b.size()) c[i] += b[i];
    }
    return c;
}

poly pminus(const poly &a, const poly &b) {
    poly c(max(a.size(), b.size()));
    for(int i = 0; i < c.size(); i ++) {
        if(i < a.size()) c[i] += a[i];
        if(i < b.size()) c[i] -= b[i];
    }
    return c;
}

void preduce(poly &a, poly &b) {
    int x = 0;
    for(auto y : a)
        if(y) x = gcd(x, abs(y));
    for(auto y : b)
        if(y) x = gcd(x, abs(y));
    
    for(auto &y : a) 
        if(y) y /= x;
    for(auto &y : b) 
        if(y) y /= x;

    x = min(a.size(), b.size());
    for(int i = 0; i < a.size(); i ++)
        if(a[i]) {x = min(x, i); break;}
    for(int i = 0; i < b.size(); i ++)
        if(b[i]) {x = min(x, i); break;}
    
    if(x) {
        for(int i = 0; i < a.size(); i ++)
            a[i] = i + x < a.size() ? a[i + x] : 0;
        for(int i = 0; i < b.size(); i ++)
            b[i] = i + x < b.size() ? b[i + x] : 0;
    }
}

ppp fpplus(const ppp &a, const ppp &b) {
    ppp ret = ppp{pplus(pmul(a.first, b.second), pmul(b.first, a.second)), pmul(a.second, b.second)};
    preduce(ret.first, ret.second);
    return ret;
}

ppp fpminus(const ppp &a, const ppp &b) {
    ppp ret = ppp{pminus(pmul(a.first, b.second), pmul(b.first, a.second)), pmul(a.second, b.second)};
    preduce(ret.first, ret.second);
    return ret;
}
ppp fpmul(const ppp &a, const ppp &b) {
    ppp ret = ppp{pmul(a.first, b.first), pmul(a.second, b.second)};
    preduce(ret.first, ret.second);
    return ret;
}

ppp fpmul(const ppp &a, int b) {
    ppp ret = a;
    for(auto &x : ret.first) x *= b;
    preduce(ret.first, ret.second);
    return ret;
}

poly p[N], bin[N];

int c[N][N];

void printP(const poly &a) {
    bool printed = false;
    for(int i = a.size() - 1; i >= 0; i --) {
        if(a[i] != 0) {
            if(printed && a[i] > 0) cout << "+";
            if(i) cout << a[i] << "x^" << i;
            else cout << a[i];
            printed = true;
        }
    }
    if(!printed) cout << "0";
}

void printFp(const ppp &a) {
    cout << "(";
    printP(a.first);
    cout << ") / (";
    printP(a.second);
    cout << ")\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    dp[0] = {poly(1), poly(1)};
    dp[0].second[0] = 1;

    p[0] = bin[0] = poly(1, 1);
    p[1] = poly(2);
    p[1][1] = 1;

    bin[1] = poly(2);
    bin[1][0] = -1;
    bin[1][1] = 1;

    for(int i = 2; i < N; i ++) {
        p[i] = pmul(p[i - 1], p[1]);
        bin[i] = pmul(bin[i - 1], bin[1]);
    }

    c[0][0] = 1;
    for(int i = 1; i < N; i ++) {
        c[i][0] = 1;
        for(int j = 1; j <= i; j ++)
            c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
        
        cout << i << ": ";
        dp[i] = ppp{p[0], p[0]};
        for(int j = 0; j < i; j ++)
            dp[i] = fpplus(dp[i], fpmul(fpmul(dp[j], c[i][j]), ppp{bin[j], p[i]}));
        dp[i] = fpmul(dp[i], ppp{p[i], pminus(p[i], bin[i])});

        printFp(dp[i]);
    }
    return 0;
}